#ifndef	_EBM_PASSBACK_H
#define _EBM_PASSBACK_H

#define __PACKED__    __attribute__ ((__packed__)) 


#define swap32(value) \
( (value & 0x000000FFU) << 24 | (value & 0x0000FF00U) << 8 | \
(value & 0x00FF0000U) >> 8 | (value & 0xFF000000U) >> 24 )

#define swap16(value) \
( (value & 0x00FFU) << 8 | (value & 0xFF00U) >> 8 )

struct _PASSBACK_FIXED_HEADER{
unsigned short head_flag;
unsigned short version;
unsigned int session_id;
unsigned char type;
//unsigned char sign_flag;
unsigned short data_len;
unsigned char src_socde[12];
unsigned short items;
unsigned char items_arry[12];
unsigned char business_type;
unsigned short business_len;
unsigned char business_data;
}__PACKED__;

typedef struct _PASSBACK_FIXED_HEADER PASSBACK_FIXED_HEADER;


enum {
PASSBACK_HEARTTICK= 0x10,
PASSBACK_QUERY= 0x11,
PASSBACK_FAILURE= 0x13,
PASSBACK_PLAY_SWITCH= 0x14,
PASSBACK_PLAY_STA= 0x15,
PASSBACK_PLAY_RECORD= 0x16,
};


struct _HEART_TICK_HEADER{
unsigned char sta;
unsigned char register_1st_time;
unsigned char phyid_len;
unsigned char phyid[6];
}__PACKED__;

typedef struct _HEART_TICK_HEADER HEART_TICK_CONTENT;



void passback_net_start(unsigned int remote_ip, unsigned short remote_port);

void passback_net_stop(void);

void passback_net_restart(void);

void *passback_task(void *parm);



#endif



